package com.jsmile.cloud.authc.api.res;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.jsmile.mall.api.enums.MenuTypeEnum;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ApiModel
@Data
public class ResSysResources implements java.io.Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Long id;
    @ApiModelProperty(value = "资源名称")
    private String name;
    @ApiModelProperty(value = "资源地址")
    private String url;
    @ApiModelProperty(value = "parent_id")
    private Long parentId;
    @ApiModelProperty(value = "权限编码")
    private String permCode;
    @ApiModelProperty(value = "资源图标")
    private String iconCls;
    @ApiModelProperty(value = "资源级别")
    private Integer level;
    @ApiModelProperty(value = "排序")
    private Integer sort;
    @ApiModelProperty(value = "1菜单 2 权限 3外部链接")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Integer menuType;
    @ApiModelProperty(value = "描述")
    private String remark;
    @ApiModelProperty(value = "创建时间")
    private java.util.Date createTime;
    @ApiModelProperty(value = "创建者")
    private String createBy;
    @ApiModelProperty(value = "更新时间")
    private java.util.Date updateTime;
    @ApiModelProperty(value = "更新者")
    private String updateBy;
    @ApiModelProperty(value = "是否启用 1是  0否")
    private Integer enable;
    @ApiModelProperty(value = "是否叶子节点")
    private Integer leaf;
    @ApiModelProperty(value = "所属系统")
    private String sysNo;
    @ApiModelProperty(value = "租户id")
    private Long tenantId;

    public String getMenuTypeName() {
        return MenuTypeEnum.nameOf(this.getMenuType());
    }
}
